Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

370
Visualizações
SyntaxError: Unexpected token, expected "," -- React w Typescript (.tsx)

I know several variations of this question have been asked. But, I haven't been able to find a solution for this particular case. Apologies in advance if I've overlooked something.

I'm getting the following error:

Unexpected token, expected "," (25:25)

function render( basename:string ) {
                         ^

Here's the function that is being pointed to in index.tsx:

function render( basename:string ) {
  ReactDOM.render(
    <StrictMode>
      <Router basename={basename}>
        ...
      </Router>
    </StrictMode>,
    document.getElementById(target),
  );
};

One thing to note, the red error line doesn't show up in the code. It just breaks with the above error when trying to serve my UI container. I'm using webpack to serve using a few plugins in my webpack.config.js. I have typescript installed. I'm wondering if this is a linter error?

Here's the local tsconfig.json

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "target": "es2020",
    "jsx": "react-jsx",
    "types": ["jest", "cypress", "@testing-library/cypress", "@testing-library/jest-dom"]
  },
  "include": ["src", "test", "webpack.config.js", "jest.config.js", "babel.config.js"]
}

... which extends

{
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }

edit: .eslintrc.json

{
  "env": {
    "node": true,
    "cypress/globals": true
  },
  "extends": ["plugin:cypress/recommended"],
  "plugins": ["cypress"]
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda